﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Nim.AI
{
    public class NimMove
    {
        private int row, number, score, games;

        //This constructor is used when loading States from the file
        public NimMove(int row, int number, int score, int games)
        {
            this.row = row;
            this.number = number;
            this.score = score;
            this.games = games;
        }

        //This constuctor is used when inserting a move into the statemanager
        public NimMove(int row, int number)
        {
            this.row = row;
            this.number = number;
        }

        //** Accessors **//

        public int Row
        {
            get
            {
                return row;
            }
            set
            {
                row = value;
            }
        }

        public int Number
        {
            get
            {
                return number;
            }
            set
            {
                number = value;
            }
        }

        public int Score
        {
            get
            {
                return score;
            }
            set
            {
                score = value;
            }
        }

        public int Games
        {
            get
            {
                return games;
            }
            set
            {
                games = value;
            }
        }

        public double Percentage
        {
            get
            {
                if (score == 0) return 0.0;
                return games / score;
            }
        }
    }
}
